Abstract: Replication lag in Mongo database is serious problem in replication environment if the reporting is done through secondary server, In replication environment the read only query can be routed to secondary server, however if there is huge lag then it can result into inconsistent data. In the current version this issue has not been addressed, In the proposed system, an attempt has been made to overcome with this problem. Before execution of query the session should verify the lag, if the lag is beyond the specified limit then the query should be re-routed back to primary. This is possible through continuous short messaging between primary and secondary. The metadata about the lag can send through the messaging, upon reading message the secondary server should re-direct the query to primary server.
Keywords: Mongo DB, Replication, Lag, Consistency, Replica set, NoSQL, CAP Theoram.